feat: add radosgw-admin multisite read wrappers - #809
Draft
johnramsden wants to merge 4 commits into
Draft
Conversation
Add the inert read-only plumbing for RGW multisite replication (CE062): a radosgw-admin exec wrapper with a remote-cluster variant and typed, JSON-backed wrappers for realm get, zonegroup get, zone get, metadata sync status, per-source data sync status, and the mdlog/datalog head markers. Catch-up verdicts are computed deterministically from local sync markers versus the peer's log heads (readable over RADOS through an imported remote), using the same per-shard comparison rule the radosgw-admin sync status text applies internally; that text is not parsed at all since the command ignores --format json on both squid and tentacle. Failing commands yield zero-value results with a nil error, mirroring the RBD wrapper contract, so the upcoming replication handler can treat an unconfigured gateway as ordinary disabled state. Fixtures are captured from a live two-site squid deployment, covering master, secondary and unconfigured views. Nothing calls this code yet; the replication handler arrives in a follow-up. Assisted-by: claude-code:claude-fable-5 Signed-off-by: John Ramsden <john.ramsden@canonical.com>
sabaini
requested changes
Aug 10, 2026
sabaini
left a comment
Collaborator
There was a problem hiding this comment.
Hey, thanks for this @johnramsden left a few nits / questions
johnramsden
marked this pull request as draft
August 11, 2026 01:20
Signed-off-by: John Ramsden <john.ramsden@canonical.com>
ComputeRgwMetadataSyncVerdict and ComputeRgwDataSyncVerdict now derive FullSyncShards as NumShards minus the count confirmed incremental, matching upstream radosgw-admin's total_behind formula (shards_behind.size() + (num_shards - num_inc)) instead of only counting shards explicitly present with a non-incremental state. A shard missing from the response entirely - not just one explicitly reported full sync - now blocks CaughtUp, instead of being silently ignored. Addresses Peter Sabaini's PR canonical#809 review comment: "the worry is that if partial/initializing shards could be reported as caught up." Assisted-by: claude-code:claude-sonnet-5 Signed-off-by: John Ramsden <john.ramsden@canonical.com>
Address Peter Sabaini's PR canonical#809 review comments: "suggest to check invariants before returning as a safety, later on we do indexing on keys e.g. eg. NumShards >= 0, keys between 0 and NumShards. if NumShards==0 i think there must not be markers?" Signed-off-by: John Ramsden <john.ramsden@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add plumbing for RGW multisite replication
Failing commands yield zero-value results with a nil error, mirroring the RBD wrapper contract, so the upcoming replication handler can treat an unconfigured gateway as ordinary disabled state.
Fixtures are captured from a live two-site squid deployment, covering master, secondary and unconfigured views.
Nothing calls this code yet; the replication handler arrives in a follow-up.
Type of change
How has this been tested?
Mocked unit tests exercise new functions
Contributor checklist
Please check that you have: